package com.globallogic.javatrainings.sergiiivanov.model;

/**
 * Covers implementation of name uniqueness mechanics.<br>
 * Adds {@link #hasDuplicates(String)} method that should fail normal execution
 * if unique name rule is broken.<br>
 * <br>
 * Usage: <li>{@link Person#addObserver(NameUniqueObserver)},
 * {@link Person#hasDuplicate(String)}
 * 
 * @author Sergey
 * 
 */
public interface NameUniqueObserver {
    /**
     * should fail normal execution if unique name rule is broken
     * 
     * @param name
     * @throws UniversityWarning
     *             when equal name is found
     */
    void hasDuplicates(String name) throws UniversityWarning;
}
